'''
1. 显示等待
2. 隐式等待
3. sleep死等
'''
from kyb_cap import driver
from time import sleep
from appium.webdriver.common.appiumby import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
# 写法1
register_btn_loc = driver.find_element(By.ID,'com.tal.kaoyan:id/login_register_text')
# driver是webdriver对象，30是最长等待时间，0.5是每0.5秒去查询对应的元素。
# until后面跟的等待具体条件，EC是判断条件，检查元素是否存在于页面的 DOM 上。
ele = WebDriverWait(driver, 30, 0.5).until(EC.visibility_of_element_located(register_btn_loc))
ele.click()
sleep(3)
